<!DOCTYPE html>
<html>
<head>
    <title>8D跟踪反馈记录</title>
    #parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak>
    <div>
        <Row :gutter="16" style="margin: 8px 0px 0px 1px">
            <div class="search-group">
                <i-col span="4">
                    <i-input v-model="q.name" @on-enter="query" placeholder="名称"></i-input>
                </i-col>
                <i-button @click="query">查询</i-button>
                <i-button @click="reloadSearch">重置</i-button>
            </div>
        </Row>
        <table id="jqGrid"></table>
    </div>
</div>
<script>
    let devCode = getQueryString("devCode")

    $(function () {
        $("#jqGrid").Grid({
            url: '../follow8drecord/list?devCode=' + devCode,
            colModel: [
                {label: 'id', name: 'id', index: 'ID', key: true, hidden: true},
                {label: '设备编码', name: 'devCode', index: 'DEV_CODE', width: 80},
                {label: '设备名称', name: 'devName', index: 'DEV_NAME', width: 80},
                {label: '责任人', name: 'personLia', index: 'PERSON_LIA', width: 80},
                {label: '预防措施', name: 'precaution', index: 'PRECAUTION', width: 80},
                {
                    label: '故障发生时间', name: 'happenDate', index: 'HAPPEN_DATE', width: 80, formatter: function (value) {
                        return transDate(value, 'yyyy-MM-dd')
                    }
                },
                {label: '工位名称', name: 'workName', index: 'WORK_NAME', width: 80},
                {label: '生产线ID', name: 'proLineId', index: 'PRO_LINE_ID', width: 80},
                {label: '车间', name: 'workshopName', index: 'WORKSHOP_NAME', width: 80},
                {label: '创建人员', name: 'createName', index: 'CREATE_USER', width: 80},
                {
                    label: '创建时间', name: 'createDate', index: 'CREATE_DATE', width: 80, formatter: function (value) {
                        return transDate(value, 'yyyy-MM-dd')
                    }
                },
                {label: '审核人', name: 'reviewerName', index: 'REVIEWER', width: 80},
                {
                    label: '审核状态',
                    name: 'reviewStatus',
                    index: 'REVIEW_STATUS',
                    width: 80,
                    formatter: function (value) {
                        return sysEnums.CHECK_FLAG[value]
                    }
                },
                {
                    label: '审核时间', name: 'reviewTime', index: 'REVIEW_TIME', width: 80, formatter: function (value) {
                        return transDate(value, 'yyyy-MM-dd')
                    }
                },
                {label: '复审人', name: 'recheckUserName', index: 'RECHECK_USER', width: 80},
                {
                    label: '复审状态',
                    name: 'recheckStatus',
                    index: 'RECHECK_STATUS',
                    width: 80,
                    formatter: function (value) {
                        return sysEnums.RECHECK_STATUS[value]
                    }
                },
                {
                    label: '复审时间', name: 'recheckTime', index: 'RECHECK_TIME', width: 80, formatter: function (value) {
                        return transDate(value, 'yyyy-MM-dd')
                    }
                },
                {label: '8D附件', name: 'file8d', index: 'FILE_8D', width: 80}
                // {label: '备注', name: 'remark', index: 'REMARK', width: 80},
                // {label: '实际关闭时间', name: 'relCloseDate', index: 'REL_CLOSE_DATE', width: 80},
                // {label: '计划关闭时间', name: 'closeDate', index: 'CLOSE_DATE', width: 80},
                // {label: '问题描述', name: 'faultDescr', index: 'FAULT_DESCR', width: 80},
                // {label: '故障现象', name: 'faultAppear', index: 'FAULT_APPEAR', width: 80},
                // {label: '工位ID', name: 'workId', index: 'WORK_ID', width: 80},
                // {label: '生产线', name: 'proLineName', index: 'PRO_LINE_NAME', width: 80},
                // {label: '生产线ID', name: 'proLineId', index: 'PRO_LINE_ID', width: 80},
                // {label: '车间ID', name: 'workshopId', index: 'WORKSHOP_ID', width: 80},
                // {label: '状态 字典表', name: 'status', index: 'STATUS', width: 80},
                // {label: '设备ID', name: 'devId', index: 'DEV_ID', width: 80},
                // {label: '工位序号', name: 'workNo', index: 'WORK_NO', width: 80},
                // {label: '修改人员', name: 'updateUser', index: 'UPDATE_USER', width: 80},
                // {label: '修改时间', name: 'updateDate', index: 'UPDATE_DATE', width: 80},

            ]
        });
    });

    let vm = new Vue({
        el: '#rrapp',
        data: {
            q: {
                name: ''
            }
        },
        methods: {
            query: function () {
                vm.reload();
            },
            reload: function (event) {
                let page = $("#jqGrid").jqGrid('getGridParam', 'page');
                $("#jqGrid").jqGrid('setGridParam', {
                    postData: {'name': vm.q.name},
                    page: page
                }).trigger("reloadGrid");
                vm.handleReset('formValidate');
            },
            reloadSearch: function () {
                vm.q = {
                    name: ''
                };
                vm.reload();
            },
            handleSubmit: function (name) {
                handleSubmitValidate(this, name, function () {
                    vm.saveOrUpdate()
                });
            },
            handleReset: function (name) {
                handleResetForm(this, name);
            }
        }
    });
</script>
</body>
</html>
